//
//  Extension+UIImageView.swift
//  LZTWeibo
//
//  Created by Yin jianxun on 16/8/10.
//  Copyright © 2016年 YinJianxun. All rights reserved.
//

import UIKit
import SDWebImage

extension UIImageView {
    
    //便利函数
    convenience init(imgName: String) {
        
        //调用系统的init(image:)方法,简化image的设置
        self.init(image: UIImage(named: imgName))
        
    }
    
    //sd_webImage 的封装
    func lzt_setImageWithString(imgName: String?, placeHolderImgName: String) {
        
        self.sd_setImageWithURL(NSURL(string: imgName ?? ""), placeholderImage: UIImage(named: placeHolderImgName))
        
    }
}
